#!/bin/bash

script_dir=$(dirname $(realpath $0))
source "${script_dir}/check-toolchain"
source "${script_dir}/config"

echo -e "\033[42m\t\tStart build kernel\033[0m"
echo "linux: ${linux}"
echo "arch: ${arch}"
echo "cross compile: ${cross_compile}"

# 检查编译工具链
check-toolchain flex
check-toolchain bison
check-toolchain bc

cd $linux
make ARCH=$arch CROSS_COMPILE=$cross_compile vexpress_defconfig
make ARCH=$arch CROSS_COMPILE=$cross_compile -j $cpu_core
